; rddir.inc
; file directory management

	MAX_FILES = 99
	MAX_NAME_LENGTH = 16

	FILE_TYPE_DELETED = 0
	FILE_TYPE_SEQUENTIAL = 1
	FILE_TYPE_PROGRAM = 2
	FILE_TYPE_USER = 3
	FILE_TYPE_RELATIVE = 4
	
	FILE_FLAG_OPEN = $80
	FILE_FLAG_PROTECTED = $20

.struct DirEntry
	name		.byte 16		; file name (zero terminated)
	type		.byte			; file type (see above)
	bank		.byte			; bank of first block
	address		.byte			; address (high) of first block
	losize		.byte			; file size (low byte)
	blocks		.word			; file size (full blocks)
.endstruct

.IFDEF _IN_RDDIR

	.export dir_init
	.export dir_find
	.export dir_add
	.export dir_del
	.export dir_build
	
.ELSE

	.import dir_init
	.import dir_find
	.import dir_add
	.import dir_del 
	.import dir_build

.ENDIF
